package com.io.entity;

import com.io.common.Comment;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Type;
import org.springframework.data.annotation.CreatedDate;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * The class/interface
 *
 * @author guodd
 * @version 1.0 use jdk 1.8
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@MappedSuperclass
public class BaseEntity {
    @Id
    @Column(name = "id")
    @Comment("主键ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    /**
     * 创建时间
     */
    @Column(name = "createTime")
    @Comment("创建时间")
    @CreatedDate
    private LocalDateTime createTime;
    /**
     * 更新时间
     */
    @Column(name = "updateTime")
    @Comment("更新时间")
    private LocalDateTime updateTime;
    /**
     * 创建人
     */
    @Column(name = "createBy")
    @Comment("创建人")
    private String createBy;
    /**
     * 更新人
     */
    @Column(name = "updateBy")
    @Comment("更新人")
    private String updateBy;
    /**
     * 删除标识0-正常；1-删除
     * （true_false=T_F；numeric_boolean=0_1；yes_no=Y_N）
     */
    @Type(type = "numeric_boolean")
    @Column(name = "delFlag")
    @Comment("删除标识")
    private Boolean delFlag;
    /**
     * 大文本数据
     */
    @Lob
    @Column(columnDefinition = "text")
    @Comment("大文本数据")
    private String text;
    /**
     * 备注
     */
    @Column(name = "remark")
    @Comment("备注")
    private String remark;
}
